<?php

/**
 * Equipo form base class.
 *
 * @method Equipo getObject() Returns the current form's model object
 *
 * @package    ehockey
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseEquipoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'        => new sfWidgetFormInputHidden(),
      'club_id'   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Club'), 'add_empty' => false)),
      'sector'    => new sfWidgetFormChoice(array('choices' => array('Damas' => 'Damas', 'Caballeros' => 'Caballeros'))),
      'categoria' => new sfWidgetFormChoice(array('choices' => array('Primera' => 'Primera', 'Segunda' => 'Segunda', 'Tercera' => 'Tercera', 'Cuarta' => 'Cuarta', 'Quinta' => 'Quinta', 'Sexta' => 'Sexta', 'Septima' => 'Septima', 'Octava' => 'Octava', 'Novena' => 'Novena'))),
      'letra'     => new sfWidgetFormChoice(array('choices' => array('A' => 'A', 'B' => 'B', 'C' => 'C', 'D' => 'D', 'E' => 'E', 'F' => 'F'))),
    ));

    $this->setValidators(array(
      'id'        => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
      'club_id'   => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Club'))),
      'sector'    => new sfValidatorChoice(array('choices' => array(0 => 'Damas', 1 => 'Caballeros'))),
      'categoria' => new sfValidatorChoice(array('choices' => array(0 => 'Primera', 1 => 'Segunda', 2 => 'Tercera', 3 => 'Cuarta', 4 => 'Quinta', 5 => 'Sexta', 6 => 'Septima', 7 => 'Octava', 8 => 'Novena'))),
      'letra'     => new sfValidatorChoice(array('choices' => array(0 => 'A', 1 => 'B', 2 => 'C', 3 => 'D', 4 => 'E', 5 => 'F'))),
    ));

    $this->widgetSchema->setNameFormat('equipo[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Equipo';
  }

}
